<header class="main-header">
    <nav class="navbar navbar-static-top">
        <div class="container">
            <div class="navbar-header">
                <a href="/" class="navbar-brand"><b>{{site.title}}</b></a>
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
                    <i class="fa fa-bars"></i>
                </button>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse pull-left" id="navbar-collapse">
                <ul class="nav navbar-nav">
                    <li {{#equals menu 'new'}}class="active"{{/equals}}><a href="/new">最新发表</a></li>
                    <li {{#equals menu 'hot'}}class="active"{{/equals}}><a href="/hot">热门文章 <span class="sr-only">(current)</span></a></li>
                    <li {{#equals menu 'fire'}}class="active"{{/equals}}><a href="/fire"><i class="fa fa-fire text-red"></i> 被点亮的文章</a></li>


                </ul>
            </div>


            <!-- Navbar Right Menu -->
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li><a href="#" id="searchBtn"><i class="fa fa-search"></i></a></li>
                    {{#if session.user}}
                       <!-- User Account Menu -->
                       <li class="dropdown user user-menu">
                           <!-- Menu Toggle Button -->
                           <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                               <!-- The user image in the navbar-->
                               <img src="{{gravatar session.user.email}}" class="user-image" alt="User Image">
                               <!-- hidden-xs hides the username on small devices so only the image appears. -->
                               <span class="hidden-xs">{{session.user.username}}</span>
                           </a>
                           <ul class="dropdown-menu">
                               <!-- The user image in the menu -->
                               <li class="user-header">
                                   <img src="{{gravatar session.user.email}}" class="img-circle" alt="User Image">
                                   <p>
                                       <a href="/u/{{session.user.username}}" class="text-white">{{session.user.username}}</a>
                                       <small><b>{{timeFromNow session.user.created_at}}</b> 加入本站</small>
                                   </p>
                               </li>
                               <!-- Menu Body -->
                               <li class="user-body">
                                   <div class="row">
                                       <div class="col-md-12">
                                           <div class="text-center small">
                                               {{session.user.signature}}
                                           </div>
                                       </div>
                                   </div>
                                   <!-- /.row -->
                               </li>
                               <!-- Menu Footer-->
                               <li class="user-footer">
                                   <div class="row">
                                       <div class="col-md-6">
                                           <a href="/dashboard" class="btn btn-primary btn-block"> <i class="fa fa-dashboard"></i> 管理中心</a>
                                       </div>

                                       <div class="col-md-6">
                                           <a href="/logout" class="btn btn-default btn-block"> <i class="fa fa-sign-out"></i> 退出</a>
                                       </div>
                                   </div>
                               </li>
                           </ul>
                       </li>
                   {{else}}
                       <li>
                           <a href="/login"> <i class="fa fa-sign-in"></i> 登录</a>
                       </li>
                       <li><a href="/join"> <i class="fa fa-asterisk"></i> 注册</a></li>
                   {{/if}}
                </ul>
            </div>
            <form method="get" style="display: none" class=" navbar-form navbar-right" role="search" action="http://www.google.com/search" target="_blank">
                <div class="form-group has-feedback">
                    <span class=" glyphicon glyphicon-search form-control-feedback-left text-primary" aria-hidden="true"></span>
                    <input class="form-control input-radius input-sm feedback-left-input" style="padding-right: 10px; min-width: 220px; margin-top: 2px;" type="text" name="q" placeholder="Google Search">
                </div>
                <input type="hidden" name="ie" value="UTF-8">
                <input type="hidden" name="oe" value="UTF-8">
                <input type="hidden" name="hl" value="zh-CN">
                <input type="hidden" name="domains" value="wincn.net">
                <input type="hidden" name="sitesearch" value="wincn.net">
            </form>
            <!-- /.navbar-custom-menu -->
        </div>
        <!-- /.container-fluid -->
    </nav>
</header>
